package ${t.packagePath}.controller;

import ${t.packagePath}.utils.AjaxJson;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@RestController
public class CacheController {
    /**
     * 获取一些基本预览信息
     */
    @RequestMapping("/RedisConsole/getPreInfo")
    public AjaxJson getPreInfo() {
        return AjaxJson.getSuccessData(new HashMap<String,Object>());
    }

    /**
     * 查询key集合
     */
    @RequestMapping("/RedisConsole/getKeys")
    public AjaxJson getKeys(String k) {
        List<String> keys = new ArrayList<>();
    return AjaxJson.getSuccessData(keys);
    }

    /**
    * 查询某个值的详细信息
    */
    @RequestMapping("/RedisConsole/getByKey")
    public AjaxJson getByKey(String key) {
    return AjaxJson.getSuccessData(new HashMap<String,Object>());
    }

    /**
    * 添加一个键值
    */
    @RequestMapping("/RedisConsole/set")
    public AjaxJson set(String key, String value, long ttl) {
    return AjaxJson.getSuccess();
    }

    /**
    * 删除一个键值
    */
    @RequestMapping("/RedisConsole/del")
    public AjaxJson del(String key) {
    return AjaxJson.getSuccess();
    }

    /**
    * 修改一个值的value
    */
    @RequestMapping("/RedisConsole/updateValue")
    public AjaxJson updateValue(String key, String value) {

    return AjaxJson.getSuccess();
    }

    /**
    * 修改一个值的ttl
    */
    @RequestMapping("/RedisConsole/updateTtl")
    public AjaxJson updateTtl(String key, long ttl) {

    return AjaxJson.getSuccess();
    }

    /**
    * 删除多个键值
    */
    @RequestMapping("/RedisConsole/deleteByKeys")
    public AjaxJson deleteByKeys() {
    return AjaxJson.getSuccess();
    }
    }